import sys
import os
import requests

# sys.path.append("..")
# sys.path.append("../utils")
# os.environ.update({"DJANGO_SETTINGS_MODULE": "server.settings"})
# django.setup()
# from django.test import Client

# client = Client()

# baseUrl = u"http://127.0.0.1:8000/api/system/"

baseUrl = u"http://192.168.10.3:8000/api/system/"


def IPOperate():
    iputData = {      
        "token":"61aa3da28253d3877c20", 
        "userId":"3", 
        "userIP":"127.0.0.1", 
        "operating":"0",          
    }
    res = requests.post(baseUrl + 'IPoperate/', data=iputData)
    print(res.content)

def systemStatusGet():
    iputData = {      
        "token":"a45eb477cf7417ab74d0",
        'page':'1',
        'maxItem' : '5',
        'group' : 0,        
    }
    res = requests.post(baseUrl + 'status/', data=iputData)
    print(res.content)

def systemScreen():
    iputData = {      
        "token":"61aa3da28253d3877c20",
        'page':'1',
        'maxItem' : '5',
        'storehouseName' : '测试',        
    }
    res = requests.post(baseUrl + 'find/', data=iputData)
    print(res.content)


if __name__ == '__main__':
    # IPOperate()
    systemStatusGet()
    # systemScreen()